export default () => {
  // 搜索配置
  const searchOption = ref({
    formConfig: {
      // 消费时间
      execTime: {
        label: "消费时间",
        component: "el-date-picker",
        type: "datetimerange",
        format: "YYYY-MM-DD HH:mm:ss",
        valueFormat: "YYYY-MM-DD HH:mm:ss",
      },
      // 关联订单
      bizId: {
        label: "关联订单",
        component: "el-input",
      },
      // 发送手机号
      mobile: {
        label: "手机号",
        component: "el-input",
      },
      // 短信类型
      smsType: {
        label: "短信类型",
        component: "el-select",
        dicUrl: Api.application.smsTypeList,
        dicFormatter: res => {
          const list = Array.isArray(res.data) ? res.data : [];
          return list.map(i => ({ label: i.description, value: i.type }));
        },
      },
      // 短信内容
      smsContent: {
        label: "短信内容",
        component: "el-input",
      },
      // 消费对象
      consumer: {
        label: "消费对象",
        component: "el-input",
      },
      // 操作人员
      operator: {
        label: "操作人员",
        component: "el-input",
      },
      // 发送状态
      smsSendStat: {
        label: "发送状态",
        component: "el-select",
        dicUrl: Api.application.sendStatus,
        dicFormatter: res => {
          const list = Array.isArray(res.data) ? res.data : [];
          return list.map(i => ({ label: i.message, value: i.code }));
        },
      },
      // 报告时间
      reportTime: {
        label: "报告时间",
        component: "el-date-picker",
        type: "datetimerange",
        format: "YYYY-MM-DD HH:mm:ss",
        valueFormat: "YYYY-MM-DD HH:mm:ss",
      },
    },
  });

  const tableOption = ref(
    Utils.tools.deleteSearchConfig({
      menu: false,
      column: {
        execTime: {
          label: "消费时间",
          minWidth: 170,
          type: "datetime",
          valueFormat: "YYYY-MM-DD HH:mm:ss",
        },
        bizId: {
          label: "关联订单",
          minWidth: 150,
        },
        mobile: {
          label: "发送手机",
        },
        smsType: {
          label: "短信类型",
          minWidth: 150,
        },
        smsContent: {
          label: "短信内容",
          minWidth: 360,
        },
        smsCount: {
          label: "消费数量(条)",
          minWidth: 150,
        },
        consumer: {
          label: "消费对象",
        },
        operator: {
          label: "操作人员",
        },
        smsSendStatus: {
          label: "发送状态",
        },
        reportTime: {
          label: "报告时间",
          minWidth: 170,
          type: "datetime",
          valueFormat: "YYYY-MM-DD HH:mm:ss",
        },
        smsSendCode: {
          label: "错误代码",
        },
      },
    })
  );
  return { searchOption, tableOption };
};
